;--------------------------------------------------------
; File Created by SN-SDCC : SinoMCU ANSI-C Compiler
; Version 2.0.0 (Dec 11 2019) (MINGW32)
; This file was generated Fri Aug 22 19:59:16 2025
;--------------------------------------------------------
; MC30 port for the RISC core
;--------------------------------------------------------
;	.file	"main.c"
	list	p=6060
	radix dec
	include "6060.inc"
;--------------------------------------------------------
; external declarations
;--------------------------------------------------------
	extern	_clear_ram
	extern	_INDFbits
	extern	_T0CNTbits
	extern	_PCLbits
	extern	_STATUSbits
	extern	_FSRbits
	extern	_P0bits
	extern	_P1bits
	extern	_MCRbits
	extern	_KBIMbits
	extern	_PCLATHbits
	extern	_PDCONbits
	extern	_ODCONbits
	extern	_PUCONbits
	extern	_INTECONbits
	extern	_INTFLAGbits
	extern	_T0CRbits
	extern	_DDR0bits
	extern	_DDR1bits
	extern	_PWMCRbits
	extern	_T1DAT1bits
	extern	_T1DAT2bits
	extern	_TM0CRbits
	extern	_T1CRbits
	extern	_T1CNTbits
	extern	_T1LOADbits
	extern	_T1DAT0bits
	extern	_INDF
	extern	_T0CNT
	extern	_PCL
	extern	_STATUS
	extern	_FSR
	extern	_P0
	extern	_P1
	extern	_MCR
	extern	_KBIM
	extern	_PCLATH
	extern	_PDCON
	extern	_ODCON
	extern	_PUCON
	extern	_INTECON
	extern	_INTFLAG
	extern	_T0CR
	extern	_DDR0
	extern	_DDR1
	extern	_PWMCR
	extern	_T1DAT1
	extern	_T1DAT2
	extern	_TM0CR
	extern	_T1CR
	extern	_T1CNT
	extern	_T1LOAD
	extern	_T1DAT0
;--------------------------------------------------------
; global declarations
;--------------------------------------------------------
	global	_C_RAM
	global	_ConfigSet
	global	_main
	global	_ram

	global STK06
	global STK05
	global STK04
	global STK03
	global STK02
	global STK01
	global STK00

sharebank udata_ovr 0x0010
STK06	res 1
STK05	res 1
STK04	res 1
STK03	res 1
STK02	res 1
STK01	res 1
STK00	res 1

;--------------------------------------------------------
; global definitions
;--------------------------------------------------------
;--------------------------------------------------------
; absolute symbol definitions
;--------------------------------------------------------
;--------------------------------------------------------
; compiler-defined variables
;--------------------------------------------------------
;--------------------------------------------------------
; initialized data
;--------------------------------------------------------

ID_main_0	idata
_ram
	db	0x00
	db	0x01
	db	0x02
	db	0x03
	db	0x04
	db	0x05
	db	0x06
	db	0x07
	db	0x08
	db	0x09


;@Allocation info for local variables in function 'C_RAM'
;@C_RAM clear_ram                 Allocated to registers ;size:2
;@C_RAM C_RAM                     Allocated to registers ;size:2
;@C_RAM INDFbits                  Allocated to registers ;size:1
;@C_RAM T0CNTbits                 Allocated to registers ;size:1
;@C_RAM PCLbits                   Allocated to registers ;size:1
;@C_RAM STATUSbits                Allocated to registers ;size:1
;@C_RAM FSRbits                   Allocated to registers ;size:1
;@C_RAM P0bits                    Allocated to registers ;size:1
;@C_RAM P1bits                    Allocated to registers ;size:1
;@C_RAM MCRbits                   Allocated to registers ;size:1
;@C_RAM KBIMbits                  Allocated to registers ;size:1
;@C_RAM PCLATHbits                Allocated to registers ;size:1
;@C_RAM PDCONbits                 Allocated to registers ;size:1
;@C_RAM ODCONbits                 Allocated to registers ;size:1
;@C_RAM PUCONbits                 Allocated to registers ;size:1
;@C_RAM INTECONbits               Allocated to registers ;size:1
;@C_RAM INTFLAGbits               Allocated to registers ;size:1
;@C_RAM T0CRbits                  Allocated to registers ;size:1
;@C_RAM DDR0bits                  Allocated to registers ;size:1
;@C_RAM DDR1bits                  Allocated to registers ;size:1
;@C_RAM PWMCRbits                 Allocated to registers ;size:1
;@C_RAM T1DAT1bits                Allocated to registers ;size:1
;@C_RAM T1DAT2bits                Allocated to registers ;size:1
;@C_RAM TM0CRbits                 Allocated to registers ;size:1
;@C_RAM T1CRbits                  Allocated to registers ;size:1
;@C_RAM T1CNTbits                 Allocated to registers ;size:1
;@C_RAM T1LOADbits                Allocated to registers ;size:1
;@C_RAM T1DAT0bits                Allocated to registers ;size:1
;@C_RAM ram                       Allocated to registers ;size:10
;@C_RAM INDF                      Allocated to registers ;size:1
;@C_RAM T0CNT                     Allocated to registers ;size:1
;@C_RAM PCL                       Allocated to registers ;size:1
;@C_RAM STATUS                    Allocated to registers ;size:1
;@C_RAM FSR                       Allocated to registers ;size:1
;@C_RAM P0                        Allocated to registers ;size:1
;@C_RAM P1                        Allocated to registers ;size:1
;@C_RAM MCR                       Allocated to registers ;size:1
;@C_RAM KBIM                      Allocated to registers ;size:1
;@C_RAM PCLATH                    Allocated to registers ;size:1
;@C_RAM PDCON                     Allocated to registers ;size:1
;@C_RAM ODCON                     Allocated to registers ;size:1
;@C_RAM PUCON                     Allocated to registers ;size:1
;@C_RAM INTECON                   Allocated to registers ;size:1
;@C_RAM INTFLAG                   Allocated to registers ;size:1
;@C_RAM T0CR                      Allocated to registers ;size:1
;@C_RAM DDR0                      Allocated to registers ;size:1
;@C_RAM DDR1                      Allocated to registers ;size:1
;@C_RAM PWMCR                     Allocated to registers ;size:1
;@C_RAM T1DAT1                    Allocated to registers ;size:1
;@C_RAM T1DAT2                    Allocated to registers ;size:1
;@C_RAM TM0CR                     Allocated to registers ;size:1
;@C_RAM T1CR                      Allocated to registers ;size:1
;@C_RAM T1CNT                     Allocated to registers ;size:1
;@C_RAM T1LOAD                    Allocated to registers ;size:1
;@C_RAM T1DAT0                    Allocated to registers ;size:1
;@end Allocation info for local variables in function 'C_RAM';
;@Allocation info for local variables in function 'ConfigSet'
;@end Allocation info for local variables in function 'ConfigSet';
;@Allocation info for local variables in function 'main'
;@end Allocation info for local variables in function 'main';

;--------------------------------------------------------
; overlayable items in internal ram 
;--------------------------------------------------------
;	udata_ovr
;--------------------------------------------------------
; reset vector 
;--------------------------------------------------------
STARTUP	code 0x0000
	goto	_main
;--------------------------------------------------------
; code
;--------------------------------------------------------
code_main	code
;***
;  pBlock Stats: dbName = M
;***
;entry:  _main	;Function start
; 2 exit points
;has an exit
;functions called:
;   _C_RAM
;   _ConfigSet
;   _C_RAM
;   _ConfigSet
;; Starting pCode block
_main	;Function start
; 2 exit points
;	.line	32; "main.c"	GIE = 0;
	BCLR	_INTECONbits,7
;	.line	33; "main.c"	C_RAM();
	CALL	_C_RAM
;	.line	34; "main.c"	ConfigSet();
	CALL	_ConfigSet
;	.line	35; "main.c"	GIE  = 1;
	BSET	_INTECONbits,7
_00114_DS_
;	.line	37; "main.c"	P10D=0;
	BCLR	_P1bits,0
;	.line	38; "main.c"	P10D=1;
	BSET	_P1bits,0
	GOTO	_00114_DS_
;	.line	40; "main.c"	}
	RETURN	
; exit point of _main

;***
;  pBlock Stats: dbName = C
;***
;entry:  _ConfigSet	;Function start
; 2 exit points
;has an exit
;; Starting pCode block
_ConfigSet	;Function start
; 2 exit points
;	.line	21; "main.c"	P0 = 0x00;
	CLRR	_P0
;	.line	22; "main.c"	P1 = 0x00;
	CLRR	_P1
;	.line	23; "main.c"	DDR0 = 0x00; //1:input 0:output
	CLRR	_DDR0
;	.line	24; "main.c"	DDR1 = 0x00;
	CLRR	_DDR1
;	.line	25; "main.c"	PUCON = 0xff; //0:Effective 1:invalid
	MOVAI	0xff
	MOVRA	_PUCON
;	.line	26; "main.c"	PDCON = 0xff;  //0:Effective 1:invalid
	MOVAI	0xff
	MOVRA	_PDCON
;	.line	27; "main.c"	T0CR = 0x05; 
	MOVAI	0x05
	MOVRA	_T0CR
;	.line	28; "main.c"	T0CNT = 256 - 125;
	MOVAI	0x83
	MOVRA	_T0CNT
;	.line	29; "main.c"	T0IE = 1;
	BSET	_INTECONbits,0
;	.line	30; "main.c"	}
	RETURN	
; exit point of _ConfigSet

;***
;  pBlock Stats: dbName = C
;***
;entry:  _C_RAM	;Function start
; 2 exit points
;has an exit
;; Starting pCode block
_C_RAM	;Function start
; 2 exit points
;	.line	18; "main.c"	__endasm;
	movai	0x40
	movra	FSR
	movai	48
	movra	0x07
	decr	FSR
	clrr	INDF
	djzr	0x07
	goto	$ -3;
	clrr	0x07
	
;	.line	19; "main.c"	}
	RETURN	
; exit point of _C_RAM


;	code size estimation:
;	   23+    0 =    23 instructions (   46 byte)

	end
